﻿using Dapper;
using System;
using BCEntity.Trading.Enquiry.SaleEnquiryChecklist;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.Trading.Enquiry.SaleEnquiryChecklist
{
    /// <summary>
    /// 销售询盘清单
    /// </summary>
    public interface ISaleEnquiryChecklistData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="saleEnquiryChecklistId">销售询盘清单Id</param>
        Task<bool> Exists(long saleEnquiryChecklistId);
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="saleEnquiryId">销售询盘单Id</param>
        /// <param name="saleGoodsNormId">销售商品款式Id</param>
        Task<bool> Exists(long saleEnquiryId,long saleGoodsNormId);
        /// <summary>
        /// 增加销售询盘清单
        /// </summary>
        /// <param name="entity">销售询盘清单信息</param>
        Task<SaleEnquiryChecklistEntity> Add(SaleEnquiryChecklistEntity entity);
        /// <summary>
        /// 更新销售询盘清单
        /// </summary>
        /// <param name="entity">销售询盘清单信息</param>
        Task<SaleEnquiryChecklistEntity> Update(SaleEnquiryChecklistEntity entity);
        /// <summary>
        /// 增加询盘清单商品数量
        /// </summary>
        /// <param name="saleEnquiryChecklistId">销售询盘清单Id</param>
        Task<SaleEnquiryChecklistEntity> IncreaseSaleCount(long saleEnquiryChecklistId);

        /// <summary>
        /// 减少询盘清单商品数量
        /// </summary>
        /// <param name="saleEnquiryChecklistId">销售询盘清单Id</param>
        Task<SaleEnquiryChecklistEntity> ReduceSaleCount(long saleEnquiryChecklistId);
        /// <summary>
        /// 删除销售询盘清单
        /// </summary>
        /// <param name="saleEnquiryChecklistId">销售询盘清单Id</param>
        Task<bool> Delete(long saleEnquiryChecklistId);
        /// <summary>
        /// 删除销售询盘清单
        /// </summary>
        /// <param name="saleEnquiryId">销售询盘单Id</param>
        /// <returns></returns>
        Task<bool> DeleteEnquiry(long saleEnquiryId);
        /// <summary>
        /// 获取销售询盘清单
        /// </summary>
        /// <param name="saleEnquiryChecklistId">销售询盘清单Id</param>
        Task<SaleEnquiryChecklistEntity> GetEntity(long saleEnquiryChecklistId);

        /// <summary>
        /// 获取销售询盘清单
        /// </summary>
        /// <param name="saleEnquiryId">销售询盘单Id</param>
        /// <param name="saleGoodsNormId">销售商品款式Id</param>
        Task<SaleEnquiryChecklistEntity> GetEntity(long saleEnquiryId, long saleGoodsNormId);
        /// <summary>
        /// 获取销售询盘清单列表
        /// </summary>
        /// <param name="saleEnquiryId">销售询盘单Id</param>
        Task<IEnumerable<SaleEnquiryChecklistEntity>> GetList(long saleEnquiryId);
        /// <summary>
        /// 获取销售询盘清单分页列表
        /// </summary>
        /// <param name="saleEnquiryId">销售询盘单Id</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<SaleEnquiryChecklistEntity>, int)> Query(long? saleEnquiryId, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }


}